classdef OriginalDataInfo
    %ORIGINALDATAINFO
    
    properties
        
        Filename = ':::::'; % 5 colons indicate that it is set in the constructor
        DateRecorded = datevec('20-08-2009', 'dd-mm-yyyy'); % any date..
        DestinationDataset = 1;
        
    end
    
    methods
        
        function obj = set.Filename(obj,filename)
            %             disp(['fname ' filename])
            %             disp(obj.Filename)
            if strcmp(obj.Filename, ':::::')
                obj.Filename = filename;
                return
            end
            if ~(ischar(filename))
                error('Filename must be a string.')
            end
            if ~(exist(filename, 'file') == 2)
                error('Path not found.')
            end
            obj.Filename = filename;
            %             disp(['fname ' filename])
            %             disp(obj.Filename)
        end % Filename set function
        
    end
    
    methods(Static)
        
        function dispHeader()
            fprintf(1,'                 Filename |   Recorded | Dataset\n');
            fprintf(1,'   -----------------------|------------|--------\n');
        end
        
        function dispRow(obj)
            if length(obj.Filename)>20
                f = obj.Filename(length(obj.Filename)-19:length(obj.Filename));
                f(1:2) = '.';
            else
                f = obj.Filename;
            end
            fprintf(1,'     %20s | %s | %4d\n', f, datestr(obj.DateRecorded, 'dd-mm-yyyy'), obj.DestinationDataset);
            
        end
        
        function dispFooter()
            fprintf(1,'   ---------------------------------------------\n');
        end
        
    end
    
end

